package com.shq.ex1.bus.activity;

import android.app.ActivityGroup;

import android.content.Intent;

import android.os.Bundle;
import android.view.LayoutInflater;


import android.widget.TabHost;
import android.widget.TextView;

import com.shq.ex1.R;

public class XianResultActivity extends ActivityGroup {

	private TabHost tabhost = null;//声明TabHost控件的对象
	private TextView xianInfo = null;
	private String xianInfoStr = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.xian_result);

		tabhost = (TabHost) findViewById(android.R.id.tabhost);//获取TabHost对象
		Intent intent = getIntent();
		String databasePath = intent.getStringExtra("databasePath");
		String xianlu = intent.getStringExtra("xianlu");
		tabhost.setup(this.getLocalActivityManager());//初始化TabHost组件
		LayoutInflater inflater = LayoutInflater.from(this);//声明并实例化一个LayoutInflater对象
		inflater.inflate(R.layout.zhanbyxian1, tabhost.getTabContentView());
		inflater.inflate(R.layout.zhanbyxian2, tabhost.getTabContentView());


		tabhost.addTab(tabhost.newTabSpec("tab").setIndicator("查看去程").setContent(new Intent(this,ZhanByXianActivity01.class).putExtra("databasePath", databasePath).putExtra("xianlu", xianlu)));//添加第一个标签页
		tabhost.addTab(tabhost.newTabSpec("tab1").setIndicator("查看返程").setContent(new Intent(this,ZhanByXianActivity02.class).putExtra("databasePath", databasePath).putExtra("xianlu", xianlu)));//添加第二个标签页
		xianInfo = (TextView) findViewById(R.id.xianInfo);
		xianInfoStr = intent.getStringExtra("xianInfoStr");
		xianInfo.setText(xianInfoStr);


	}
}
